package com.tiancheng.trade.merchant.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.apache.commons.lang3.StringUtils;

import jakarta.validation.constraints.NotBlank;
import java.util.List;

@Data
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@TableName(value = "organization")
public class Organization extends BaseModel {
    /**
     * 机构编码/机构ID
     */
    @NotBlank
    private String organizationCode;
    /**
     * 机构名称
     */
    @NotBlank
    private String organizationName;
    /**
     * 备注
     */
    private String remark;

    @TableField(exist = false)
    private Integer currentPage;

    @TableField(exist = false)
    private Integer pageSize;

    @TableField(exist = false)
    private List<Merchant> merchants;

    public String getOrganizationCode() {
        if (StringUtils.isNotEmpty(organizationCode)) {
            organizationCode = organizationCode.trim();
        }
        return organizationCode;
    }

    public String getOrganizationName() {
        if (StringUtils.isNotEmpty(organizationName)) {
            organizationName = organizationName.trim();
        }
        return organizationName;
    }

}
